import { ElMessage, ElMessageBox } from 'element-plus'
import 'element-plus/dist/index.css'
export const commonPlugins = {
  install(app, options) {
    // element组件用法 -- 报错提示框
    app.use(ElMessage)

    // element组件用法 -- 确认框
    app.config.globalProperties.$confirm = (content, options) =>
      ElMessageBox.confirm(
        content,
        options.title,
        {
          confirmButtonText: '确认',
          cancelButtonText: '取消',
          type: options.type ?? 'info'
        }
      )


    // 原生写法
    // app.config.globalProperties.$message = {
    //   error: (msg) => {
    //     // 错误提示
    //     alert(msg)
    //   }
    // }


  }
}